<?php

/*
|--------------------------------------------------------------------------
| Web Routes``  
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

//练习
Route::get('/demos', function () {
    return view('demotest/demos');
});


Route::get('/', 'AuthController@index');  //首页
// 供养页
Route::get('/welcome', function () {
    return view('welcome');
});
// 商品页
Route::get('/product', function () {
    return view('product');
});

// 购物车1
Route::get('/buycar', function () {
    return view('buyCar');
});
// 购物车2
Route::get('/buycar2', function () {
    return view('buyCar_Two');
});
// 购物车3
Route::get('/buycar3', function () {
    return view('buyCar_Three');
});
Route::any('login', 'AuthController@login'); //登录
Route::any('do_login', 'AuthController@do_login'); //执行登录
Route::any('regist', 'AuthController@regist'); //注册
Route::get('logout', 'AuthController@logout'); // 退出登录
Route::get('Cart', 'MyController@Cart'); // 购物车 不登录


//个人中心
Route::prefix('member')->group(function () {
    Route::get('personal', function(){
        return view('member/personal');
    }); //个人首页

    Route::any('personal_save', function(){
        return view('member/personal_save');
    }); //信息修改

    Route::any('personal_safe',function(){
        return view('member/personal_safe');
    }); //安全

    Route::any('my_message',function(){
        return view('member/my_message');
    }); //我的消息

    Route::any('reading',function(\Illuminate\Http\Request $request){
        $message_id=$request->get('message_id');
        $type=$request->get('type');
        return view('member/reading',['message_id'=>$message_id,'type'=>$type]);
    }); //我的消息详情页

});

//订单中心
Route::prefix('ordercenter')->group(function () {
    Route::get('myIndent',function (){
        return view('ordercenter/myIndent');
    });//我的订单

    Route::get('delivery_address', function(){
        return view('ordercenter/delivery_address');
    }); //收获地址

    Route::get('add_delivery_address',function (){
        return view('ordercenter/add_delivery_address');
    });//添加收获地址

    Route::get('save_delivery_address',function (\Illuminate\Http\Request $request){
        $address_id=$request->get('address_id');
        return view('ordercenter/save_delivery_address',['address_id'=>$address_id]);
    });//修改收获地址

    Route::get('discounts',function (){
        return view('ordercenter/discounts');
    });//修改收获地址
});

